package com.yuw.oop.duotai;

public class Person {
    // 属性
    private String perName;
    private String perSex;
    private int perAge;

    // getter/setter接口

    public String getPerName() {
        return perName;
    }

    public void setPerName(String perName) {
        this.perName = perName;
    }

    public String getPerSex() {
        return perSex;
    }

    public void setPerSex(String perSex) {
        this.perSex = perSex;
    }

    public int getPerAge() {
        return perAge;
    }

    public void setPerAge(int perAge) {
        this.perAge = perAge;
    }

    //提供构造方法
    // 默认的构造方法
    public Person() {
        System.out.println("执行了父类Person的默认的构造方法");
    }

    // 构造方法
    public Person(String perName, String perSex, int perAge) {
        this.perName = perName;
        this.perSex = perSex;
        this.perAge = perAge;
        System.out.println("执行了父类Person的自定义的构造方法");
    }

    // 行为

    /**
     * 吃饭的行为
     */
    public void doEating() {
        // 行为
        System.out.println("I am eating...");
    }

    /**
     * 睡觉的行为
     */
    public void doSleeping() {
        System.out.println("I am sleeping...");
    }
}
